//
//  nomal_member_init.hpp
//  learnC++
//
//  Created by apple on 2018/6/3.
//  Copyright © 2018年 yunfan.com. All rights reserved.
//

#ifndef nomal_member_init_hpp
#define nomal_member_init_hpp

#include <stdio.h>
#include <iostream>
#include <string>
class rectangle{
  
private:
    double m_length = 1.0;
    double m_width = 1.0;
    
public:
    rectangle(double length,double width)
    :m_length{length},m_width(width)
    {
        
    }
    
    void print(){
        std::cout << "length: " << m_length << ", width: " << m_width << '\n';
    }
    
};

//Example
class Ball {
private:
    std::string m_color = "black";
    double m_radius = 10.0;

public:
    Ball(){
        
    }
    
    Ball(const std::string &color):m_color(color){
    }
    
    Ball(double radius):m_radius(radius){
        
    }
    
    Ball(const std::string &color,double radius):m_color(color),m_radius(radius){
        
    }
    
};



#endif /* nomal_member_init_hpp */
